package debtbundler.domain.entity.impl;

/**
 * An entity that can notify its registered <code>EntityListener</code>s 
 * about updates in this entity.
 * <p>
 * An update means a change of this entity's own attribute, such as new string 
 * valued name or a new item in a collection attribute. It does not mean 
 * a change in e.g. the name of an entity within a collection in this entity.
 * 
 * @see EntityListener
 * @author Anssi
 *
 */
public interface ListenableEntity {

	/**
	 * @param listener	the listener to add
	 * @return			<code>true</code> if the listener was added
	 */
	public boolean addEntityListener(EntityListener listener);
	
	/**
	 * @param listener	the listener to remove
	 * @return			<code>true</code> if the listener was removed 
	 */
	public boolean removeEntityListener(EntityListener listener);
	
}
